/*
 * NewUI.java
 *
 * Created on __DATE__, __TIME__
 */

package com.lele.ui;

import java.awt.event.ActionEvent;
import java.io.IOException;

import javax.swing.JFrame;
import javax.swing.JOptionPane;

import com.lele.create.CreateCatalog;
import com.lele.create.CreateFile;
import com.lele.file.SuperFile;
import com.lele.ui.check.CheckField;

/**
 * 
 * @author __USER__
 */
public class UI_v2 extends JFrame {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	/** Creates new form NewUI */
	public UI_v2() {
		initComponents();
	}

	// GEN-BEGIN:initComponents
	// <editor-fold defaultstate="collapsed" desc="Generated Code">
	@SuppressWarnings({ "unchecked", "rawtypes" })
	private void initComponents() {
		jPanel1 = new javax.swing.JPanel();
		jPanel2 = new javax.swing.JPanel();
		jPanel3 = new javax.swing.JPanel();
		jLabel1 = new javax.swing.JLabel();
		jLabel2 = new javax.swing.JLabel();
		jLabel3 = new javax.swing.JLabel();
		jLabel4 = new javax.swing.JLabel();
		jLabel5 = new javax.swing.JLabel();
		jlField1 = new javax.swing.JLabel();
		jlField2 = new javax.swing.JLabel();
		jlField3 = new javax.swing.JLabel();
		jlField4 = new javax.swing.JLabel();
		jlField5 = new javax.swing.JLabel();
		jlField6 = new javax.swing.JLabel();
		jlField7 = new javax.swing.JLabel();
		jlField8 = new javax.swing.JLabel();
		jlField9 = new javax.swing.JLabel();
		jlField10 = new javax.swing.JLabel();
		jlField11 = new javax.swing.JLabel();
		jlField12 = new javax.swing.JLabel();

		tfProject_root = new javax.swing.JTextField();
		tfProject_name = new javax.swing.JTextField();
		tfPackage_url = new javax.swing.JTextField();
		tfEntityClass = new javax.swing.JTextField();
		tfDB_name = new javax.swing.JTextField();
		jButton1 = new javax.swing.JButton();
		btnCreatePackage = new javax.swing.JButton();
		btnOK = new javax.swing.JButton();
		btnExit = new javax.swing.JButton();
		btnCreateJAR = new javax.swing.JButton();

		tfField1 = new javax.swing.JTextField();
		tfField2 = new javax.swing.JTextField();
		tfField3 = new javax.swing.JTextField();
		tfField4 = new javax.swing.JTextField();
		tfField5 = new javax.swing.JTextField();
		tfField6 = new javax.swing.JTextField();
		tfField7 = new javax.swing.JTextField();
		tfField8 = new javax.swing.JTextField();
		tfField9 = new javax.swing.JTextField();
		tfField10 = new javax.swing.JTextField();
		tfField11 = new javax.swing.JTextField();
		tfField12 = new javax.swing.JTextField();

		cbField1 = new javax.swing.JComboBox();
		cbField2 = new javax.swing.JComboBox();
		cbField3 = new javax.swing.JComboBox();
		cbField4 = new javax.swing.JComboBox();
		cbField5 = new javax.swing.JComboBox();
		cbField6 = new javax.swing.JComboBox();
		cbField7 = new javax.swing.JComboBox();
		cbField8 = new javax.swing.JComboBox();
		cbField9 = new javax.swing.JComboBox();
		cbField10 = new javax.swing.JComboBox();
		cbField11 = new javax.swing.JComboBox();
		cbField12 = new javax.swing.JComboBox();

		setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
		setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
		setResizable(false);
		setTitle("Extjs+SSH代码生成器 PowerBy:赜 v3.0");
		jLabel1.setText("\u9879\u76ee\u8def\u5f84\uff1a");

		tfProject_root.setText("E:\\Workspaces\\");
		tfProject_name.setText("leleCMS");
		tfEntityClass.setText("Test");
		tfPackage_url.setText("com\\lele\\cms");
		tfDB_name.setText("lelecms");

		jLabel2.setText("\u9879\u76ee\u540d\u79f0\uff1a");

		jLabel3.setText("\u5305\u3000\u3000\u540d\uff1a");

		jLabel4.setText("\u5b9e\u4f53\u540d\u79f0\uff1a");

		jLabel5.setText("\u3000\u6570\u636e\u5e93\uff1a");

		jButton1.setText("\u7f16\u8f91\u5b9e\u4f53");
		jButton1.addActionListener(new java.awt.event.ActionListener() {
			public void actionPerformed(java.awt.event.ActionEvent evt) {
				jButton1ActionPerformed(evt);
			}
		});
		javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(
				jPanel1);
		jPanel1.setLayout(jPanel1Layout);
		jPanel1Layout
				.setHorizontalGroup(jPanel1Layout
						.createParallelGroup(
								javax.swing.GroupLayout.Alignment.LEADING)
						.addGroup(
								jPanel1Layout
										.createSequentialGroup()
										.addContainerGap()
										.addGroup(
												jPanel1Layout
														.createParallelGroup(
																javax.swing.GroupLayout.Alignment.TRAILING,
																false)
														.addGroup(
																javax.swing.GroupLayout.Alignment.LEADING,
																jPanel1Layout
																		.createSequentialGroup()
																		.addComponent(
																				jLabel5)
																		.addPreferredGap(
																				javax.swing.LayoutStyle.ComponentPlacement.RELATED)
																		.addComponent(
																				tfDB_name))
														.addGroup(
																javax.swing.GroupLayout.Alignment.LEADING,
																jPanel1Layout
																		.createSequentialGroup()
																		.addComponent(
																				jLabel3)
																		.addPreferredGap(
																				javax.swing.LayoutStyle.ComponentPlacement.RELATED)
																		.addComponent(
																				tfPackage_url))
														.addGroup(
																javax.swing.GroupLayout.Alignment.LEADING,
																jPanel1Layout
																		.createSequentialGroup()
																		.addComponent(
																				jLabel1)
																		.addPreferredGap(
																				javax.swing.LayoutStyle.ComponentPlacement.RELATED)
																		.addComponent(
																				tfProject_root,
																				javax.swing.GroupLayout.PREFERRED_SIZE,
																				116,
																				javax.swing.GroupLayout.PREFERRED_SIZE)))
										.addPreferredGap(
												javax.swing.LayoutStyle.ComponentPlacement.RELATED,
												35, Short.MAX_VALUE)
										.addGroup(
												jPanel1Layout
														.createParallelGroup(
																javax.swing.GroupLayout.Alignment.LEADING,
																false)
														.addComponent(
																jLabel4,
																javax.swing.GroupLayout.DEFAULT_SIZE,
																javax.swing.GroupLayout.DEFAULT_SIZE,
																Short.MAX_VALUE)
														.addComponent(jLabel2))
										.addPreferredGap(
												javax.swing.LayoutStyle.ComponentPlacement.RELATED)
										.addGroup(
												jPanel1Layout
														.createParallelGroup(
																javax.swing.GroupLayout.Alignment.LEADING)
														.addGroup(
																jPanel1Layout
																		.createParallelGroup(
																				javax.swing.GroupLayout.Alignment.LEADING,
																				false)
																		.addComponent(
																				tfEntityClass)
																		.addComponent(
																				tfProject_name,
																				javax.swing.GroupLayout.PREFERRED_SIZE,
																				121,
																				javax.swing.GroupLayout.PREFERRED_SIZE))
														.addComponent(jButton1))
										.addGap(21, 21, 21)));
		jPanel1Layout
				.setVerticalGroup(jPanel1Layout
						.createParallelGroup(
								javax.swing.GroupLayout.Alignment.LEADING)
						.addGroup(
								jPanel1Layout
										.createSequentialGroup()
										.addContainerGap()
										.addGroup(
												jPanel1Layout
														.createParallelGroup(
																javax.swing.GroupLayout.Alignment.LEADING)
														.addGroup(
																jPanel1Layout
																		.createSequentialGroup()
																		.addGroup(
																				jPanel1Layout
																						.createParallelGroup(
																								javax.swing.GroupLayout.Alignment.BASELINE)
																						.addComponent(
																								jLabel1)
																						.addComponent(
																								tfProject_root,
																								javax.swing.GroupLayout.PREFERRED_SIZE,
																								javax.swing.GroupLayout.DEFAULT_SIZE,
																								javax.swing.GroupLayout.PREFERRED_SIZE))
																		.addPreferredGap(
																				javax.swing.LayoutStyle.ComponentPlacement.RELATED)
																		.addGroup(
																				jPanel1Layout
																						.createParallelGroup(
																								javax.swing.GroupLayout.Alignment.BASELINE)
																						.addComponent(
																								jLabel3)
																						.addComponent(
																								tfPackage_url,
																								javax.swing.GroupLayout.PREFERRED_SIZE,
																								javax.swing.GroupLayout.DEFAULT_SIZE,
																								javax.swing.GroupLayout.PREFERRED_SIZE))
																		.addPreferredGap(
																				javax.swing.LayoutStyle.ComponentPlacement.RELATED)
																		.addGroup(
																				jPanel1Layout
																						.createParallelGroup(
																								javax.swing.GroupLayout.Alignment.BASELINE)
																						.addComponent(
																								jLabel5)
																						.addComponent(
																								tfDB_name,
																								javax.swing.GroupLayout.PREFERRED_SIZE,
																								javax.swing.GroupLayout.DEFAULT_SIZE,
																								javax.swing.GroupLayout.PREFERRED_SIZE)))
														.addGroup(
																jPanel1Layout
																		.createSequentialGroup()
																		.addGroup(
																				jPanel1Layout
																						.createParallelGroup(
																								javax.swing.GroupLayout.Alignment.BASELINE)
																						.addComponent(
																								jLabel2)
																						.addComponent(
																								tfProject_name,
																								javax.swing.GroupLayout.PREFERRED_SIZE,
																								javax.swing.GroupLayout.DEFAULT_SIZE,
																								javax.swing.GroupLayout.PREFERRED_SIZE))
																		.addPreferredGap(
																				javax.swing.LayoutStyle.ComponentPlacement.RELATED)
																		.addGroup(
																				jPanel1Layout
																						.createParallelGroup(
																								javax.swing.GroupLayout.Alignment.BASELINE)
																						.addComponent(
																								jLabel4)
																						.addComponent(
																								tfEntityClass,
																								javax.swing.GroupLayout.PREFERRED_SIZE,
																								23,
																								javax.swing.GroupLayout.PREFERRED_SIZE))
																		.addPreferredGap(
																				javax.swing.LayoutStyle.ComponentPlacement.RELATED)
																		.addComponent(
																				jButton1)))
										.addContainerGap(
												javax.swing.GroupLayout.DEFAULT_SIZE,
												Short.MAX_VALUE)));
		btnCreateJAR.setText("导入JAR包");
		btnCreateJAR.addActionListener(new java.awt.event.ActionListener() {
			public void actionPerformed(java.awt.event.ActionEvent evt) {
				btnCreateJARActionPerformed(evt);
			}
		});

		btnCreatePackage.setText("\u751f\u6210\u5305");
		btnCreatePackage.addActionListener(new java.awt.event.ActionListener() {
			public void actionPerformed(java.awt.event.ActionEvent evt) {
				btnCreatePackageActionPerformed(evt);
			}
		});
		btnOK.setText("\u751f\u6210\u6587\u4ef6");
		btnOK.addActionListener(new java.awt.event.ActionListener() {
			public void actionPerformed(java.awt.event.ActionEvent evt) {
				btnOKActionPerformed(evt);
			}
		});
		btnExit.setText("\u9000\u51fa");
		btnExit.addActionListener(new java.awt.event.ActionListener() {
			public void actionPerformed(java.awt.event.ActionEvent evt) {
				btnExitActionPerformed(evt);
			}
		});
		javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(
				jPanel3);
		jPanel3.setLayout(jPanel3Layout);
		jPanel3Layout
				.setHorizontalGroup(jPanel3Layout
						.createParallelGroup(
								javax.swing.GroupLayout.Alignment.LEADING)
						.addGroup(
								javax.swing.GroupLayout.Alignment.TRAILING,
								jPanel3Layout
										.createSequentialGroup()
										.addGap(22, 22, 22)
										.addComponent(btnCreateJAR)
										.addPreferredGap(
												javax.swing.LayoutStyle.ComponentPlacement.RELATED,
												32, Short.MAX_VALUE)
										.addComponent(btnCreatePackage)
										.addGap(39, 39, 39).addComponent(btnOK)
										.addGap(28, 28, 28)
										.addComponent(btnExit)
										.addGap(22, 22, 22)));
		jPanel3Layout.setVerticalGroup(jPanel3Layout.createParallelGroup(
				javax.swing.GroupLayout.Alignment.LEADING).addGroup(
				jPanel3Layout
						.createParallelGroup(
								javax.swing.GroupLayout.Alignment.BASELINE)
						.addComponent(btnCreateJAR)
						.addComponent(btnCreatePackage).addComponent(btnOK)
						.addComponent(btnExit)));

		jPanel2.setBorder(javax.swing.BorderFactory.createEtchedBorder());

		jlField1.setText("\u5b57\u6bb51");

		tfField1.setText("id");
		tfField1.setName("PK");

		cbField1.setModel(new javax.swing.DefaultComboBoxModel(
				new String[] { "Integer" }));

		jlField2.setText("\u5b57\u6bb52");

		cbField2.setModel(new javax.swing.DefaultComboBoxModel(new String[] {
				"类型", "Integer", "Char" }));

		jlField3.setText("\u5b57\u6bb53");

		cbField3.setModel(new javax.swing.DefaultComboBoxModel(new String[] {
				"类型", "Integer", "Char" }));

		cbField4.setModel(new javax.swing.DefaultComboBoxModel(new String[] {
				"类型", "Integer", "Char" }));

		jlField4.setText("\u5b57\u6bb54");

		jlField5.setText("\u5b57\u6bb55");

		cbField5.setModel(new javax.swing.DefaultComboBoxModel(new String[] {
				"类型", "Integer", "Char" }));

		jlField6.setText("\u5b57\u6bb56");

		cbField6.setModel(new javax.swing.DefaultComboBoxModel(new String[] {
				"类型", "Integer", "Char" }));

		jlField7.setText("\u5b57\u6bb57");

		cbField7.setModel(new javax.swing.DefaultComboBoxModel(new String[] {
				"类型", "Integer", "Char" }));

		jlField8.setText("\u5b57\u6bb58");

		cbField8.setModel(new javax.swing.DefaultComboBoxModel(new String[] {
				"类型", "Integer", "Char" }));

		jlField9.setText("\u5b57\u6bb59");

		cbField9.setModel(new javax.swing.DefaultComboBoxModel(new String[] {
				"类型", "Integer", "Char" }));

		jlField10.setText("\u5b57\u6bb510");

		cbField10.setModel(new javax.swing.DefaultComboBoxModel(new String[] {
				"类型", "Integer", "Char" }));

		jlField11.setText("\u5b57\u6bb511");

		cbField11.setModel(new javax.swing.DefaultComboBoxModel(new String[] {
				"类型", "Integer", "Char" }));

		jlField12.setText("\u5b57\u6bb512");

		cbField12.setModel(new javax.swing.DefaultComboBoxModel(new String[] {
				"类型", "Integer", "Char" }));

		javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(
				jPanel2);
		jPanel2.setLayout(jPanel2Layout);
		jPanel2.setVisible(false);
		jPanel2Layout
				.setHorizontalGroup(jPanel2Layout
						.createParallelGroup(
								javax.swing.GroupLayout.Alignment.LEADING)
						.addGroup(
								jPanel2Layout
										.createSequentialGroup()
										.addContainerGap()
										.addGroup(
												jPanel2Layout
														.createParallelGroup(
																javax.swing.GroupLayout.Alignment.LEADING)
														.addGroup(
																jPanel2Layout
																		.createSequentialGroup()
																		.addComponent(
																				jlField3)
																		.addPreferredGap(
																				javax.swing.LayoutStyle.ComponentPlacement.RELATED)
																		.addComponent(
																				tfField3,
																				javax.swing.GroupLayout.PREFERRED_SIZE,
																				78,
																				javax.swing.GroupLayout.PREFERRED_SIZE)
																		.addPreferredGap(
																				javax.swing.LayoutStyle.ComponentPlacement.RELATED)
																		.addComponent(
																				cbField3,
																				javax.swing.GroupLayout.PREFERRED_SIZE,
																				javax.swing.GroupLayout.DEFAULT_SIZE,
																				javax.swing.GroupLayout.PREFERRED_SIZE))
														.addGroup(
																jPanel2Layout
																		.createSequentialGroup()
																		.addComponent(
																				jlField4)
																		.addPreferredGap(
																				javax.swing.LayoutStyle.ComponentPlacement.RELATED)
																		.addComponent(
																				tfField4,
																				javax.swing.GroupLayout.PREFERRED_SIZE,
																				78,
																				javax.swing.GroupLayout.PREFERRED_SIZE)
																		.addPreferredGap(
																				javax.swing.LayoutStyle.ComponentPlacement.RELATED)
																		.addComponent(
																				cbField4,
																				javax.swing.GroupLayout.PREFERRED_SIZE,
																				javax.swing.GroupLayout.DEFAULT_SIZE,
																				javax.swing.GroupLayout.PREFERRED_SIZE))
														.addGroup(
																jPanel2Layout
																		.createSequentialGroup()
																		.addComponent(
																				jlField5)
																		.addPreferredGap(
																				javax.swing.LayoutStyle.ComponentPlacement.RELATED)
																		.addComponent(
																				tfField5,
																				javax.swing.GroupLayout.PREFERRED_SIZE,
																				78,
																				javax.swing.GroupLayout.PREFERRED_SIZE)
																		.addPreferredGap(
																				javax.swing.LayoutStyle.ComponentPlacement.RELATED)
																		.addComponent(
																				cbField5,
																				javax.swing.GroupLayout.PREFERRED_SIZE,
																				javax.swing.GroupLayout.DEFAULT_SIZE,
																				javax.swing.GroupLayout.PREFERRED_SIZE))
														.addGroup(
																jPanel2Layout
																		.createSequentialGroup()
																		.addComponent(
																				jlField1)
																		.addPreferredGap(
																				javax.swing.LayoutStyle.ComponentPlacement.RELATED)
																		.addComponent(
																				tfField1,
																				javax.swing.GroupLayout.PREFERRED_SIZE,
																				78,
																				javax.swing.GroupLayout.PREFERRED_SIZE)
																		.addPreferredGap(
																				javax.swing.LayoutStyle.ComponentPlacement.RELATED)
																		.addComponent(
																				cbField1,
																				javax.swing.GroupLayout.PREFERRED_SIZE,
																				javax.swing.GroupLayout.DEFAULT_SIZE,
																				javax.swing.GroupLayout.PREFERRED_SIZE))
														.addGroup(
																jPanel2Layout
																		.createSequentialGroup()
																		.addComponent(
																				jlField2)
																		.addPreferredGap(
																				javax.swing.LayoutStyle.ComponentPlacement.RELATED)
																		.addComponent(
																				tfField2,
																				javax.swing.GroupLayout.PREFERRED_SIZE,
																				78,
																				javax.swing.GroupLayout.PREFERRED_SIZE)
																		.addPreferredGap(
																				javax.swing.LayoutStyle.ComponentPlacement.RELATED)
																		.addComponent(
																				cbField2,
																				javax.swing.GroupLayout.PREFERRED_SIZE,
																				javax.swing.GroupLayout.DEFAULT_SIZE,
																				javax.swing.GroupLayout.PREFERRED_SIZE))
														.addGroup(
																jPanel2Layout
																		.createSequentialGroup()
																		.addComponent(
																				jlField6)
																		.addPreferredGap(
																				javax.swing.LayoutStyle.ComponentPlacement.RELATED)
																		.addComponent(
																				tfField6,
																				javax.swing.GroupLayout.PREFERRED_SIZE,
																				78,
																				javax.swing.GroupLayout.PREFERRED_SIZE)
																		.addPreferredGap(
																				javax.swing.LayoutStyle.ComponentPlacement.RELATED)
																		.addComponent(
																				cbField6,
																				javax.swing.GroupLayout.PREFERRED_SIZE,
																				javax.swing.GroupLayout.DEFAULT_SIZE,
																				javax.swing.GroupLayout.PREFERRED_SIZE)))
										.addGap(22, 22, 22)
										.addGroup(
												jPanel2Layout
														.createParallelGroup(
																javax.swing.GroupLayout.Alignment.LEADING)
														.addGroup(
																jPanel2Layout
																		.createSequentialGroup()
																		.addComponent(
																				jlField8)
																		.addPreferredGap(
																				javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
																		.addComponent(
																				tfField8,
																				javax.swing.GroupLayout.PREFERRED_SIZE,
																				78,
																				javax.swing.GroupLayout.PREFERRED_SIZE)
																		.addPreferredGap(
																				javax.swing.LayoutStyle.ComponentPlacement.RELATED)
																		.addComponent(
																				cbField8,
																				javax.swing.GroupLayout.PREFERRED_SIZE,
																				javax.swing.GroupLayout.DEFAULT_SIZE,
																				javax.swing.GroupLayout.PREFERRED_SIZE))
														.addGroup(
																jPanel2Layout
																		.createSequentialGroup()
																		.addComponent(
																				jlField7)
																		.addPreferredGap(
																				javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
																		.addComponent(
																				tfField7,
																				javax.swing.GroupLayout.PREFERRED_SIZE,
																				78,
																				javax.swing.GroupLayout.PREFERRED_SIZE)
																		.addPreferredGap(
																				javax.swing.LayoutStyle.ComponentPlacement.RELATED)
																		.addComponent(
																				cbField7,
																				javax.swing.GroupLayout.PREFERRED_SIZE,
																				javax.swing.GroupLayout.DEFAULT_SIZE,
																				javax.swing.GroupLayout.PREFERRED_SIZE))
														.addGroup(
																jPanel2Layout
																		.createSequentialGroup()
																		.addComponent(
																				jlField10)
																		.addPreferredGap(
																				javax.swing.LayoutStyle.ComponentPlacement.RELATED)
																		.addComponent(
																				tfField10,
																				javax.swing.GroupLayout.PREFERRED_SIZE,
																				78,
																				javax.swing.GroupLayout.PREFERRED_SIZE)
																		.addPreferredGap(
																				javax.swing.LayoutStyle.ComponentPlacement.RELATED)
																		.addComponent(
																				cbField10,
																				javax.swing.GroupLayout.PREFERRED_SIZE,
																				javax.swing.GroupLayout.DEFAULT_SIZE,
																				javax.swing.GroupLayout.PREFERRED_SIZE))
														.addGroup(
																jPanel2Layout
																		.createSequentialGroup()
																		.addComponent(
																				jlField9)
																		.addPreferredGap(
																				javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
																		.addComponent(
																				tfField9,
																				javax.swing.GroupLayout.PREFERRED_SIZE,
																				78,
																				javax.swing.GroupLayout.PREFERRED_SIZE)
																		.addPreferredGap(
																				javax.swing.LayoutStyle.ComponentPlacement.RELATED)
																		.addComponent(
																				cbField9,
																				javax.swing.GroupLayout.PREFERRED_SIZE,
																				javax.swing.GroupLayout.DEFAULT_SIZE,
																				javax.swing.GroupLayout.PREFERRED_SIZE))
														.addGroup(
																jPanel2Layout
																		.createSequentialGroup()
																		.addComponent(
																				jlField11)
																		.addPreferredGap(
																				javax.swing.LayoutStyle.ComponentPlacement.RELATED)
																		.addComponent(
																				tfField11,
																				javax.swing.GroupLayout.PREFERRED_SIZE,
																				78,
																				javax.swing.GroupLayout.PREFERRED_SIZE)
																		.addPreferredGap(
																				javax.swing.LayoutStyle.ComponentPlacement.RELATED)
																		.addComponent(
																				cbField11,
																				javax.swing.GroupLayout.PREFERRED_SIZE,
																				javax.swing.GroupLayout.DEFAULT_SIZE,
																				javax.swing.GroupLayout.PREFERRED_SIZE))
														.addGroup(
																jPanel2Layout
																		.createSequentialGroup()
																		.addComponent(
																				jlField12)
																		.addPreferredGap(
																				javax.swing.LayoutStyle.ComponentPlacement.RELATED)
																		.addComponent(
																				tfField12,
																				javax.swing.GroupLayout.PREFERRED_SIZE,
																				78,
																				javax.swing.GroupLayout.PREFERRED_SIZE)
																		.addPreferredGap(
																				javax.swing.LayoutStyle.ComponentPlacement.RELATED)
																		.addComponent(
																				cbField12,
																				javax.swing.GroupLayout.PREFERRED_SIZE,
																				javax.swing.GroupLayout.DEFAULT_SIZE,
																				javax.swing.GroupLayout.PREFERRED_SIZE)))
										.addContainerGap(17, Short.MAX_VALUE)));
		jPanel2Layout
				.setVerticalGroup(jPanel2Layout
						.createParallelGroup(
								javax.swing.GroupLayout.Alignment.LEADING)
						.addGroup(
								jPanel2Layout
										.createSequentialGroup()
										.addContainerGap(14, Short.MAX_VALUE)
										.addGroup(
												jPanel2Layout
														.createParallelGroup(
																javax.swing.GroupLayout.Alignment.LEADING)
														.addGroup(
																javax.swing.GroupLayout.Alignment.TRAILING,
																jPanel2Layout
																		.createSequentialGroup()
																		.addGroup(
																				jPanel2Layout
																						.createParallelGroup(
																								javax.swing.GroupLayout.Alignment.BASELINE)
																						.addComponent(
																								jlField7)
																						.addComponent(
																								cbField7,
																								javax.swing.GroupLayout.PREFERRED_SIZE,
																								javax.swing.GroupLayout.DEFAULT_SIZE,
																								javax.swing.GroupLayout.PREFERRED_SIZE)
																						.addComponent(
																								tfField7,
																								javax.swing.GroupLayout.PREFERRED_SIZE,
																								javax.swing.GroupLayout.DEFAULT_SIZE,
																								javax.swing.GroupLayout.PREFERRED_SIZE))
																		.addPreferredGap(
																				javax.swing.LayoutStyle.ComponentPlacement.RELATED)
																		.addGroup(
																				jPanel2Layout
																						.createParallelGroup(
																								javax.swing.GroupLayout.Alignment.BASELINE)
																						.addComponent(
																								jlField8)
																						.addComponent(
																								cbField8,
																								javax.swing.GroupLayout.PREFERRED_SIZE,
																								javax.swing.GroupLayout.DEFAULT_SIZE,
																								javax.swing.GroupLayout.PREFERRED_SIZE)
																						.addComponent(
																								tfField8,
																								javax.swing.GroupLayout.PREFERRED_SIZE,
																								javax.swing.GroupLayout.DEFAULT_SIZE,
																								javax.swing.GroupLayout.PREFERRED_SIZE))
																		.addPreferredGap(
																				javax.swing.LayoutStyle.ComponentPlacement.RELATED)
																		.addGroup(
																				jPanel2Layout
																						.createParallelGroup(
																								javax.swing.GroupLayout.Alignment.BASELINE)
																						.addComponent(
																								jlField9)
																						.addComponent(
																								cbField9,
																								javax.swing.GroupLayout.PREFERRED_SIZE,
																								javax.swing.GroupLayout.DEFAULT_SIZE,
																								javax.swing.GroupLayout.PREFERRED_SIZE)
																						.addComponent(
																								tfField9,
																								javax.swing.GroupLayout.PREFERRED_SIZE,
																								javax.swing.GroupLayout.DEFAULT_SIZE,
																								javax.swing.GroupLayout.PREFERRED_SIZE))
																		.addPreferredGap(
																				javax.swing.LayoutStyle.ComponentPlacement.RELATED)
																		.addGroup(
																				jPanel2Layout
																						.createParallelGroup(
																								javax.swing.GroupLayout.Alignment.BASELINE)
																						.addComponent(
																								jlField10)
																						.addComponent(
																								tfField10,
																								javax.swing.GroupLayout.PREFERRED_SIZE,
																								javax.swing.GroupLayout.DEFAULT_SIZE,
																								javax.swing.GroupLayout.PREFERRED_SIZE)
																						.addComponent(
																								cbField10,
																								javax.swing.GroupLayout.PREFERRED_SIZE,
																								javax.swing.GroupLayout.DEFAULT_SIZE,
																								javax.swing.GroupLayout.PREFERRED_SIZE))
																		.addPreferredGap(
																				javax.swing.LayoutStyle.ComponentPlacement.RELATED)
																		.addGroup(
																				jPanel2Layout
																						.createParallelGroup(
																								javax.swing.GroupLayout.Alignment.BASELINE)
																						.addComponent(
																								jlField11)
																						.addComponent(
																								tfField11,
																								javax.swing.GroupLayout.PREFERRED_SIZE,
																								javax.swing.GroupLayout.DEFAULT_SIZE,
																								javax.swing.GroupLayout.PREFERRED_SIZE)
																						.addComponent(
																								cbField11,
																								javax.swing.GroupLayout.PREFERRED_SIZE,
																								javax.swing.GroupLayout.DEFAULT_SIZE,
																								javax.swing.GroupLayout.PREFERRED_SIZE))
																		.addPreferredGap(
																				javax.swing.LayoutStyle.ComponentPlacement.RELATED)
																		.addGroup(
																				jPanel2Layout
																						.createParallelGroup(
																								javax.swing.GroupLayout.Alignment.BASELINE)
																						.addComponent(
																								jlField12)
																						.addComponent(
																								tfField12,
																								javax.swing.GroupLayout.PREFERRED_SIZE,
																								javax.swing.GroupLayout.DEFAULT_SIZE,
																								javax.swing.GroupLayout.PREFERRED_SIZE)
																						.addComponent(
																								cbField12,
																								javax.swing.GroupLayout.PREFERRED_SIZE,
																								javax.swing.GroupLayout.DEFAULT_SIZE,
																								javax.swing.GroupLayout.PREFERRED_SIZE)))
														.addGroup(
																javax.swing.GroupLayout.Alignment.TRAILING,
																jPanel2Layout
																		.createSequentialGroup()
																		.addGroup(
																				jPanel2Layout
																						.createParallelGroup(
																								javax.swing.GroupLayout.Alignment.BASELINE)
																						.addComponent(
																								jlField1)
																						.addComponent(
																								tfField1,
																								javax.swing.GroupLayout.PREFERRED_SIZE,
																								javax.swing.GroupLayout.DEFAULT_SIZE,
																								javax.swing.GroupLayout.PREFERRED_SIZE)
																						.addComponent(
																								cbField1,
																								javax.swing.GroupLayout.PREFERRED_SIZE,
																								javax.swing.GroupLayout.DEFAULT_SIZE,
																								javax.swing.GroupLayout.PREFERRED_SIZE))
																		.addPreferredGap(
																				javax.swing.LayoutStyle.ComponentPlacement.RELATED)
																		.addGroup(
																				jPanel2Layout
																						.createParallelGroup(
																								javax.swing.GroupLayout.Alignment.BASELINE)
																						.addComponent(
																								jlField2)
																						.addComponent(
																								tfField2,
																								javax.swing.GroupLayout.PREFERRED_SIZE,
																								javax.swing.GroupLayout.DEFAULT_SIZE,
																								javax.swing.GroupLayout.PREFERRED_SIZE)
																						.addComponent(
																								cbField2,
																								javax.swing.GroupLayout.PREFERRED_SIZE,
																								javax.swing.GroupLayout.DEFAULT_SIZE,
																								javax.swing.GroupLayout.PREFERRED_SIZE))
																		.addPreferredGap(
																				javax.swing.LayoutStyle.ComponentPlacement.RELATED)
																		.addGroup(
																				jPanel2Layout
																						.createParallelGroup(
																								javax.swing.GroupLayout.Alignment.BASELINE)
																						.addComponent(
																								jlField3)
																						.addComponent(
																								tfField3,
																								javax.swing.GroupLayout.PREFERRED_SIZE,
																								javax.swing.GroupLayout.DEFAULT_SIZE,
																								javax.swing.GroupLayout.PREFERRED_SIZE)
																						.addComponent(
																								cbField3,
																								javax.swing.GroupLayout.PREFERRED_SIZE,
																								javax.swing.GroupLayout.DEFAULT_SIZE,
																								javax.swing.GroupLayout.PREFERRED_SIZE))
																		.addPreferredGap(
																				javax.swing.LayoutStyle.ComponentPlacement.RELATED)
																		.addGroup(
																				jPanel2Layout
																						.createParallelGroup(
																								javax.swing.GroupLayout.Alignment.BASELINE)
																						.addComponent(
																								jlField4)
																						.addComponent(
																								tfField4,
																								javax.swing.GroupLayout.PREFERRED_SIZE,
																								javax.swing.GroupLayout.DEFAULT_SIZE,
																								javax.swing.GroupLayout.PREFERRED_SIZE)
																						.addComponent(
																								cbField4,
																								javax.swing.GroupLayout.PREFERRED_SIZE,
																								javax.swing.GroupLayout.DEFAULT_SIZE,
																								javax.swing.GroupLayout.PREFERRED_SIZE))
																		.addPreferredGap(
																				javax.swing.LayoutStyle.ComponentPlacement.RELATED)
																		.addGroup(
																				jPanel2Layout
																						.createParallelGroup(
																								javax.swing.GroupLayout.Alignment.BASELINE)
																						.addComponent(
																								jlField5)
																						.addComponent(
																								tfField5,
																								javax.swing.GroupLayout.PREFERRED_SIZE,
																								javax.swing.GroupLayout.DEFAULT_SIZE,
																								javax.swing.GroupLayout.PREFERRED_SIZE)
																						.addComponent(
																								cbField5,
																								javax.swing.GroupLayout.PREFERRED_SIZE,
																								javax.swing.GroupLayout.DEFAULT_SIZE,
																								javax.swing.GroupLayout.PREFERRED_SIZE))
																		.addPreferredGap(
																				javax.swing.LayoutStyle.ComponentPlacement.RELATED)
																		.addGroup(
																				jPanel2Layout
																						.createParallelGroup(
																								javax.swing.GroupLayout.Alignment.BASELINE)
																						.addComponent(
																								jlField6)
																						.addComponent(
																								tfField6,
																								javax.swing.GroupLayout.PREFERRED_SIZE,
																								javax.swing.GroupLayout.DEFAULT_SIZE,
																								javax.swing.GroupLayout.PREFERRED_SIZE)
																						.addComponent(
																								cbField6,
																								javax.swing.GroupLayout.PREFERRED_SIZE,
																								javax.swing.GroupLayout.DEFAULT_SIZE,
																								javax.swing.GroupLayout.PREFERRED_SIZE))))
										.addContainerGap()));

		javax.swing.GroupLayout layout = new javax.swing.GroupLayout(
				getContentPane());
		getContentPane().setLayout(layout);
		layout.setHorizontalGroup(layout
				.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
				.addGroup(
						layout.createSequentialGroup()
								.addContainerGap()
								.addGroup(
										layout.createParallelGroup(
												javax.swing.GroupLayout.Alignment.LEADING)
												.addGroup(
														layout.createSequentialGroup()
																.addComponent(
																		jPanel1,
																		javax.swing.GroupLayout.DEFAULT_SIZE,
																		javax.swing.GroupLayout.DEFAULT_SIZE,
																		Short.MAX_VALUE)
																.addContainerGap())
												.addGroup(
														layout.createParallelGroup(
																javax.swing.GroupLayout.Alignment.TRAILING,
																false)
																.addComponent(
																		jPanel3,
																		javax.swing.GroupLayout.Alignment.LEADING,
																		javax.swing.GroupLayout.DEFAULT_SIZE,
																		javax.swing.GroupLayout.DEFAULT_SIZE,
																		Short.MAX_VALUE)
																.addComponent(
																		jPanel2,
																		javax.swing.GroupLayout.Alignment.LEADING,
																		javax.swing.GroupLayout.DEFAULT_SIZE,
																		javax.swing.GroupLayout.DEFAULT_SIZE,
																		Short.MAX_VALUE)))));
		layout.setVerticalGroup(layout
				.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
				.addGroup(
						layout.createSequentialGroup()
								.addGap(4, 4, 4)
								.addComponent(jPanel1,
										javax.swing.GroupLayout.PREFERRED_SIZE,
										105,
										javax.swing.GroupLayout.PREFERRED_SIZE)
								.addGap(12, 12, 12)
								.addComponent(jPanel2,
										javax.swing.GroupLayout.PREFERRED_SIZE,
										javax.swing.GroupLayout.DEFAULT_SIZE,
										javax.swing.GroupLayout.PREFERRED_SIZE)
								.addPreferredGap(
										javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
								.addComponent(jPanel3,
										javax.swing.GroupLayout.PREFERRED_SIZE,
										javax.swing.GroupLayout.DEFAULT_SIZE,
										javax.swing.GroupLayout.PREFERRED_SIZE)
								.addContainerGap(15, Short.MAX_VALUE)));

		pack();
	}

	/******************************************************************
	 * 
	 * 按钮点击事件处理 begin
	 ******************************************************************/
	private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
		if (evt.getActionCommand().equals("编辑实体")) {
			if (jPanel2.isVisible()) {
				setSize(489, 186);
				jPanel2.setVisible(false);
			} else {
				setSize(489, 430);
				jPanel2.setVisible(true);

			}
		}
	}

	private void btnCreateJARActionPerformed(ActionEvent evt) {
		if (evt.getActionCommand().equals("导入JAR包")) {
			createJAR();
		}
	}

	private void btnCreatePackageActionPerformed(java.awt.event.ActionEvent evt) {
		if (evt.getActionCommand().equals("生成包")) {
			if (checkingForm()) {
				createCatalog();
			}
		}
	}

	private void btnOKActionPerformed(java.awt.event.ActionEvent evt) {
		if (evt.getActionCommand().equals("生成文件")) {
			int x = JOptionPane.showConfirmDialog(this, "是否生成字段？");
			if (x == 1 && checkingForm()) {
				createFile();
			} else if (x == 0 && checkingForm()) {
				createFileAndEntity();
			}
		}
	}

	private void btnExitActionPerformed(java.awt.event.ActionEvent evt) {
		if (evt.getActionCommand().equals("退出")) {
			System.exit(0);
		}
	}

	/******************************************************************
	 * 
	 * 按钮点击事件处理 end
	 ******************************************************************/
	/******************************************************************
	 * 
	 * 验证表单begin
	 ******************************************************************/
	public boolean checkingForm() {
		boolean result = true;
		if (tfProject_root.getText().equals("")) {
			JOptionPane.showMessageDialog(this, "项目根目录为空！");
			result = false;
		} else if (tfProject_name.getText().equals("")) {
			JOptionPane.showMessageDialog(this, "项目名称为空！");
			result = false;
		} else if (tfPackage_url.getText().equals("")) {
			JOptionPane.showMessageDialog(this, "包为空！");
			result = false;
		} else if (tfEntityClass.getText().equals("")) {
			JOptionPane.showMessageDialog(this, "实体名称为空！");
			result = false;
		} else if (tfDB_name.getText().equals("")) {
			JOptionPane.showMessageDialog(this, "数据库为空！");
			result = false;
		}
		return result;

	}

	public SuperFile getSuperFile() {
		SuperFile sf = new SuperFile();
		sf.setProject_root(tfProject_root.getText());
		sf.setFile_url(tfProject_root.getText() + tfProject_name.getText()
				+ "\\src\\" + tfPackage_url.getText() + "\\");
		sf.setPackage_url(tfPackage_url.getText());
		sf.setEntityClass(tfEntityClass.getText());
		sf.setEntityName(tfEntityClass.getText().substring(0, 1).toLowerCase()
				+ tfEntityClass.getText().substring(1));
		sf.setDB_name(tfDB_name.getText());
		return sf;
	}

	public void createFile() {
		try {
			CreateFile.createFile(this.getSuperFile());
			JOptionPane.showMessageDialog(this, "文件生成成功！！！");
		} catch (IOException e) {
			JOptionPane.showMessageDialog(this, "文件生成出错！");
		}

	}

	public void createJAR() {
		JOptionPane.showMessageDialog(this, "待实现");
	}

	public void createFileAndEntity() {
		SuperFile sf = this.getSuperFile();
		sf.setFields(CheckField.checkField());
		try {
			CreateFile.createFile(sf);
			JOptionPane.showMessageDialog(this, "文件及字段生成成功！！！");
		} catch (IOException e) {
			JOptionPane.showMessageDialog(this, "文件及字段生成出错！");
		}
	}

	public void createCatalog() {
		CreateCatalog.createCatalog(getSuperFile());
		JOptionPane.showMessageDialog(this, "包生成成功！");
	}

	/**
	 * @param args
	 *            the command line arguments
	 */
	public static void main(String args[]) {
		java.awt.EventQueue.invokeLater(new Runnable() {
			public void run() {
				new UI_v2().setVisible(true);

			}
		});
	}

	// GEN-BEGIN:variables
	// Variables declaration - do not modify
	private javax.swing.JTextField tfDB_name;
	private javax.swing.JButton btnCreatePackage;
	private javax.swing.JButton btnExit;
	private javax.swing.JButton btnOK;
	private javax.swing.JButton btnCreateJAR;
	protected javax.swing.JComboBox<?> cbField1;
	protected javax.swing.JComboBox<?> cbField10;
	protected javax.swing.JComboBox<?> cbField11;
	protected javax.swing.JComboBox<?> cbField12;
	protected javax.swing.JComboBox<?> cbField2;
	protected javax.swing.JComboBox<?> cbField3;
	protected javax.swing.JComboBox<?> cbField4;
	protected javax.swing.JComboBox<?> cbField5;
	protected javax.swing.JComboBox<?> cbField6;
	protected javax.swing.JComboBox<?> cbField7;
	protected javax.swing.JComboBox<?> cbField8;
	protected javax.swing.JComboBox<?> cbField9;
	private javax.swing.JButton jButton1;
	private javax.swing.JLabel jLabel1;
	private javax.swing.JLabel jLabel2;
	private javax.swing.JLabel jLabel3;
	private javax.swing.JLabel jLabel4;
	private javax.swing.JLabel jLabel5;
	private javax.swing.JPanel jPanel1;
	protected static javax.swing.JPanel jPanel2;
	private javax.swing.JPanel jPanel3;
	protected javax.swing.JLabel jlField1;
	protected javax.swing.JLabel jlField10;
	protected javax.swing.JLabel jlField11;
	protected javax.swing.JLabel jlField12;
	protected javax.swing.JLabel jlField2;
	protected javax.swing.JLabel jlField3;
	protected javax.swing.JLabel jlField4;
	protected javax.swing.JLabel jlField5;
	protected javax.swing.JLabel jlField6;
	protected javax.swing.JLabel jlField7;
	protected javax.swing.JLabel jlField8;
	protected javax.swing.JLabel jlField9;
	protected javax.swing.JTextField tfEntityClass;
	protected javax.swing.JTextField tfField1;
	protected javax.swing.JTextField tfField10;
	protected javax.swing.JTextField tfField11;
	protected javax.swing.JTextField tfField12;
	protected javax.swing.JTextField tfField2;
	protected javax.swing.JTextField tfField3;
	protected javax.swing.JTextField tfField4;
	protected javax.swing.JTextField tfField5;
	protected javax.swing.JTextField tfField6;
	protected javax.swing.JTextField tfField7;
	protected javax.swing.JTextField tfField8;
	protected javax.swing.JTextField tfField9;
	private javax.swing.JTextField tfPackage_url;
	private javax.swing.JTextField tfProject_name;
	private javax.swing.JTextField tfProject_root;
	// End of variables declaration//GEN-END:variables

}